package com.wzdigit.wms.wms.service.core.task;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wzdigit.wms.basic.domain.task.TaskScheduling;
import com.wzdigit.wms.basic.enums.BaseIsEnabledEnum;
import com.wzdigit.wms.basic.mapper.core.task.TaskSchedulingMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * wms定时调度任务表 服务类
 * </p>
 *
 * @author
 * @since 2021-04-26
 */
@Service
@Slf4j
public class TaskSchedulingCodeService {

	@Autowired
	private TaskSchedulingMapper taskSchedulingMapper;
	
	/**
	 * 获取所有调度任务（启用）
	 * 
	 * @return
	 */
	public List<TaskScheduling> getUsingAll() {
		QueryWrapper<TaskScheduling> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("IS_ENABLED", BaseIsEnabledEnum.USE.code);
		return taskSchedulingMapper.selectList(queryWrapper);
	}
}
